package com.dsz.controller;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * 房型控制类
 */
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.dsz.po.House;
import com.dsz.service.HouseService;

@Controller
public class HouseController {
	//依赖注入
	@Autowired
	private HouseService houseService;
	
	
	//跳转到预定页面
	@RequestMapping(value="tobook.action")
	public String tobook() {
		return "/user/book";
	}
	@RequestMapping(value = "/tobook/{house_name}",method=RequestMethod.GET)
	public House toBook(@PathVariable("house_name") String house_name) {
		House house = houseService.findHousePrice(house_name);
		return house;
	}
}
